package com.nuscriptions.exchange.controller;

import com.nuscriptions.exchange.domain.entity.User;
import com.nuscriptions.exchange.service.api.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/test/users")
public class UserController {

    private final ISysUserService userService;

    @Autowired
    public UserController(ISysUserService userService) {
        this.userService = userService;
    }

    @GetMapping
    public List<User> getAllUsers() {
        List<User> list= userService.getAllUsers();
        User u = list.get(0);

        return list;
    }
}